package com.bookstore.controller;


import com.bookstore.bean.User;
import com.bookstore.service.UserLoginService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;

@Controller
public class LoginController {
    @Resource
    private UserLoginService userLoginService;
  //用户的登录测试页面（可用
    @RequestMapping  (value = "/login")
    public String login(@RequestParam("userId") int userId,
                        @RequestParam("password") String password){
        User u = userLoginService.login(userId,password);

        if(u != null){
            System.out.println("123");
            return "huanyin";

        }else {
           return "shibai";}
    }
}
